import java.util.Scanner;
public class Main {
    public static int fib(long n) {
        if (n >= 0) {
            int a=0;
            int b = 0;
            int c = 1;
            for(int i=2;i<=n;++i) {
                a=b;
                b=c;
                c=b+a;
            }
            return c;
        } else if (n < 0) {
            int a=0;
            int b=0;
            int c=1;
            for(int i=-2;i>=n;--i) {
                a=b;
                b=c;
                c=a-b;
            }
            return c;
        }
        return 0;
    }

    public static void main(String[] args) {
        long n;
        Scanner scanner = new Scanner(System.in);
        n=scanner.nextLong();
        System.out.println(fib(n));
    }
}
public class nsd {
}
